<script setup>
import { NList, NListItem, NButton, NCard, NText, NTooltip } from "naive-ui";
import { usePreferenceStore } from "../../../../stores/preference";
import { SetDefaultJavaDirectory } from "../../../../wailsjs/go/preference/Preference";

const pref = usePreferenceStore()

async function changeJavaDir() {
    pref.defaultJavaDir = await SetDefaultJavaDirectory()
}
</script>

<template>
    <NCard :bordered="false" embedded>
        <template #header>
            <NText :strong="true" :depth="3">
                Java
            </NText>
        </template>

        <NList hoverable :show-divider="false">
            <NListItem>
                <template #suffix>
                    <NButton text size="large" @click="changeJavaDir">
                        <NText :depth="3" underline>
                            {{ pref.defaultJavaDir }}
                        </NText>
                    </NButton>
                </template>

                <NTooltip trigger="hover" placement="top-start" :keep-alive-on-hover="false">
                    <template #trigger>
                        <NButton text size="large">Java目录</NButton>
                    </template>
                    fuck
                </NTooltip>
            </NListItem>
        </NList>
    </NCard>
</template>